package com.briup.UserBuyGoods.two;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 *
 */
public class GoodsCooccurrenceList {
    public static class GoodsCooccurrenceListMapper
                    extends Mapper<Text,Text,Text,Text>{
        @Override
        protected void map(Text key, Text value, Context context) throws IOException, InterruptedException {
            String[] str = value.toString().split(",");
            for (int i=0;i<str.length;i++){
                for (int j=0;j<str.length;j++){
                    context.write(new Text(str[i]),new Text(str[j]));
                }
            }
        }
    }
}
